﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using snat.proxy.items;
using QuickGraph;

namespace snat.model
{
    public class Edge : Connection, IEdge<object>
    {

        private List<int> messageIDs;
        public List<int> MessageID {
            get {
                return messageIDs;
            }
        }

        public void messageSent(int messageID) {
            messageIDs.Add(messageID);
        }

        public double Weight { get; set; }

        private DateTime timeStamp;
        public DateTime TimeStamp {
            get {
                return timeStamp;
            }
        }

        public Edge(Connection c, DateTime _timeStamp, double _weight = 1, bool _isGreedy = true)
            : base(c.From, c.To) {
                this.Weight = _weight;
                this.timeStamp = _timeStamp;
        }

        public Edge(BaseNode from, BaseNode to,  DateTime _timeStamp, double _weight = 1) 
            : base(from, to) {
                this.Weight = _weight;
                this.timeStamp = _timeStamp;
        }

        #region IEdge<BaseNode> Members

        public object Source {
            //TODO QUERY NetworkModel
            get { return  NetworkModel.Instance.Nodes[From.ID]; }
        }

        public object Target {
            get { return NetworkModel.Instance.Nodes[To.ID]; }
        }

        #endregion
    }
}
